############################
#
# RUN FILE
# Journal of Substance
# Abuse Treatment Archive
# B. W. Campbell
# Last Updated:  11/05/2018
#
############################

rm(list=ls())

# will need to adjust local working directory, this is BWC's
wd <- "~/Dropbox/Projects/Projects_Skyler/NetworkTCs/TNAM_pilot_data/survivalPaper/ReplicationArchive"
setwd(wd)

# install necessary packages
needed <- setdiff(c("stringr", "plyr", "igraph", "survival", "lubridate", "tnam", "ggplot2", "devtools", "riskRegression"),
                  installed.packages()[,"Package"])

if(length(needed) > 0){
  install.packages(needed, repos = "https://cloud.r-project.org/", dependencies = TRUE)
}


# Set to FALSE if the data file (CCDW_SurvivalData.RData) has already be written
write.data = FALSE

# run code to reproduce display items
source("CCDW_ReplicationArchive.R", print.eval = TRUE)

